package com.wxl.common.wiget

import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AlertDialog
import com.wxl.common.R
import kotlinx.android.synthetic.main.dialog_sleep_layout.*

class SleepDialog(context: Context) : AlertDialog(context) {

    private var l: View.OnClickListener?=null

    fun setOnClickListener(l: View.OnClickListener):SleepDialog{
        this.l = l
        return this
    }


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.dialog_sleep_layout)
        setCanceledOnTouchOutside(false)
        sleepDialogBtn.setOnClickListener {
            dismiss()
            l?.onClick(it)
        }
    }

    override fun onBackPressed() {

    }

}